package online.heycm.platform.web.common.sse;

import online.heycm.platform.common.entity.result.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

/**
 * 示例
 *
 * @author hey
 * @version 1.0
 * @date 2023/12/18 15:34
 */
@RequestMapping("/sse")
public interface SseService {

    @GetMapping("/connect/{id}")
    SseEmitter connect(@PathVariable String id);

    @GetMapping("/send/{id}")
    Result send(@PathVariable String id);

    @PostMapping("/close/{id}")
    Result close(@PathVariable String id);

}
